{include app:admin.inc.header}
<!--tmpl-resource-->
{include app:admin.inc.top}


<div class="container-fluid content-body">
	<div class="main">
		<!-- left side start-->
		{include admin.inc.menu}
		<!-- left side end-->


		<!-- main content start-->
		<section class="right-section" id="right-section">
			<!-- start of inner-frame -->
			<div class="inner-iframe">

				<!-- page breadcrumb start-->
				{include admin.inc.bread}
				<!-- page "breadcrumb end-->
				<!-- Nav tabs -->
				<ul class="nav nav-tabs">

					<li><a href="#" id="content-add"><i class="glyphicon glyphicon-plus item-add"></i> 添加分组</a></li>
					<li class="active"><a href="javascript:void(0);"><i class="glyphicon glyphicon-th-list"></i> 分组列表</a></li>
					<!--<li><a href="/admin/index/edit"><i class="glyphicon glyphicon-edit"></i> 编辑会员</a></li>-->

				</ul>
				<div class="inner-container">
					<form class="form-inline search-form" id="J_List_Form" role="form">
						<!-- search form start -->
						<!--tmpl-search-->

						
						
						<!-- searchinput -->
						<div class="form-group">
							<div class="input-group">
								<div class="input-group-addon">
									分组名称
								</div>
								<input type="text" class="form-control input-sm" maxlength="20" placeholder="关键字" name="s_name" value="{$s_name}">
							</div>
						</div>
						<!-- searchdatetime -->
						<div class="form-group">
							<div class="input-group">
								<div class="input-group-addon">
									创建时间
								</div>
								<input style="width:100px;" class="form-control form-control-inline input-sm mdate"  size="16" type="text"
								name="s_s_addtime" value="{$s_s_addtime}"
								placeholder="开始时间" />
						
								<div class="input-group-addon">
									-
								</div>
								<input style="width:100px;" class="form-control form-control-inline input-sm mdate"  size="16" type="text"
								name="s_e_addtime" value="{$s_e_addtime}"
								placeholder="结束时间" />
							</div>
						</div>
						<!-- searchinput -->
						<div class="form-group">
							<div class="input-group">
								<select name="s_status" id="select-mix-option" class="form-control input-sm">
									<option value="">状态</option>
									<option value="1" {if $s_status == "1"}selected="selected"{/if}>启用</option>
									<option value="0" {if $s_status == "0"}selected="selected"{/if}>禁用</option>
								</select>
							</div>
						</div>
						<button type="submit" class="btn btn-sm btn-success">搜索</button>
						{run exportBtn()}
						<!-- search form end -->
					<!--</form>
					<form id="J_List_Form">-->
						<div class="table-responsive">
							<table id="J_ListTable" class="table  table-hover  table-striped">
								<!--tmpl-listtable-->

								<!-- listblock -->
								<thead>
									<tr>
										<th width="20"><input type="checkbox" class="icheck check-all" /></th>
										<th>分组名称</th>
										<th>会员数</th>
										<th>创建时间</th>
										<th>创建人</th>
										<th>状态</th>
										<th>操作</th>
									</tr>
								</thead>
								<tbody>
								{if empty($items)}
								<tr>
									<td style="text-align:center;" colspan="14" class="empty-table-td">{$emptyRecord}</td>
								</tr>
								{/if}
								{loop $items $value}
								<tr>
									<td><input type="checkbox" class="icheck" name="ids[]" value="{$value[id]}"/></td>
									<!--tmpl-fieldlist-->
								
									<td>{$value[name]}</td>
									<td>{$value[total]}</td>
									<td>{$value[addtime]}</td>
									<td>{$value[manager_name]}</td>
									<td>
										<input type="checkbox" data-field="status" class="bswitch bswitch-list" data-size="mini"
											   {if $value[status]=='1'}checked{/if} {if $value[total]}disabled="disabled"{else}data-id="{$value[id]}"{/if}data-on-text="启用" data-off-text="禁用">
									</td>
									<td>
										<!--tmpl-listbtn-->
								
										<!-- listbtnedit -->
										{if in_array('admin/member/edit',$priv) || empty($priv)}
										<a href="#" data-id={$value[id]} class="btn btn-primary btn-xs item-edit">
											<i class="glyphicon glyphicon-edit"></i> 编辑</a>
										{/if}
										
										<!-- listbtndelete -->
										{if !$value[total]}
										{if in_array('admin/memberGroup/delete',$priv) || empty($priv)}
										<a href="{$delete_url}?id={$value[id]}" class="btn btn-danger btn-xs item-remove">
											<i class="glyphicon glyphicon-trash"></i> 删除</a>
										{/if}
										<a href="{$delete_url}?id={$value[id]}" class="btn btn-danger btn-xs item-remove">
											<i class="glyphicon glyphicon-trash"></i> 删除</a>
										{/if}
									</td>
								</tr>
								{/loop}
							</table>
						</div>
					</form>
					<div class="text-right">
						{$pagemenu}
					</div>
					<!--<div class="button-group">
						{if in_array('/admin/memberGroup/delete',$priv) || empty($priv)}
						<button class="btn btn-danger js-deletes btn-sm">批量删除</button>
						{/if}
					</div>-->
					<!--<div class="button-group pagination" style="float: left">
						<select name="action-bacth-select"  disabled class="form-control input-sm" >
							<option value="on" >启用</option>
							<option value="off">禁用</option>
							{if in_array('admin/memberGroup/delete',$priv) || empty($priv)}
							<option value="delete" >删除</option>
							{/if}
						</select>
					</div>-->
					<div class="btn-group dropup" data-act="operateAll">
						<button type="button" class="btn btn-warning" disabled>批量操作</button>
						<button type="button" class="btn btn-warning dropdown-toggle" data-toggle="dropdown" aria-expanded="false" disabled>
							<span class="caret"></span>
							<span class="sr-only">Toggle Dropdown</span>
						</button>
						<ul class="dropdown-menu" role="menu">
							<li><a href="#" data-action="on">启用</a></li>
							<li><a href="#" data-action="off">禁用</a></li>
							<li><a href="#" data-action="delete">删除</a></li>
							{if in_array('admin/memberGroup/delete',$priv) || empty($priv)}
							<li><a href="#" data-action="delete">删除</a></li>
							{/if}
						</ul>
					</div>
				</div>
			</div>
		</section>
	</div>
</div>

<!--footer section start-->
{include admin.inc.footer}
<!--footer section end-->

<!--tmpl-script-->

<script type="text/html" id="content-add-template">

	<form role="form" class="content-add-form" id="content-add-form" autocomplete="off">

		<div class="form-element">
			<div class="form-group">
				<label><span class="asterisk">*</span>分组名称</label>
				<input type="text" name="data[name]" value="{[item.name]}" class="form-control" maxlength="20" placeholder="分组名称" required />
			</div>
			<p class="help-block"></p>
		</div>
		<div class="form-element">
			<div class="form-group">
				<label><span class="asterisk">*</span>状态</label>
				<div>
					<input type="checkbox" class="bswitch bswitch-add"  {[if item.status == 1 ]}checked{[/if]} data-on-text="启用" data-off-text="禁用">
					<input type="hidden" name="data[status]" value="{[item.status]}">
				</div>
			</div>
			<p class="help-block"></p>
		</div>
		<!--<div class="form-element">
			<div class="form-group">
				<label class="col-sm-2 control-label">创建人</label>
				<div class="col-sm-4">
					<label class="control-label">{$adminName}</label>
				</div>
			</div>
		</div>-->
		<input type="hidden" name="id" value="{[item.id]}">
	</form>
</script>

<!-- pagescript -->
<script type="text/javascript">
	seajs.use("admin/member_groupindex",function (exports){

		exports.init({
			set_url : '/admin/memberGroup/set/',
			insert_url : '{$insert_url}',
			edit_url : '{$edit_url}',
			update_url : '{$update_url}'
		});
	});
</script>


<script id="assocpage" type="text/html">
<div class="text-right">
	<ul class="pagination blog-pagination">
		<li><a class="assoc-page" data-page="{[prev]}" href="javascript:void(0);">上一页</a></li> 
		{[loop pages page]}

		<li {[if curr == page]}class="active"{[/if]}><a class="assoc-page" data-page="{[page]}"  href="javascript:void(0)">{[page]}</a></li> 

		{[/loop]}
		<li><a class="assoc-page" href="javascript:void(0);" data-page="{[nexts]}">下一页</a></li> 
	</ul>	
</div>
</script>
</body>
</html>
